﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using OnlineMovieTicket.Services.IServices;
using OnlineMovieTicket.Services.Services;
using OnlineMovieTicket.Model;

namespace OnlineMovieTicket.WebForms.Movies
{
    public partial class MovieDetails : System.Web.UI.Page
    {
        Model.Movies movie;
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                int mvCode = Convert.ToInt32(Request.QueryString["MVCode"].ToString());
                IMoviesService movieSrv = new MoviesService();
                movie = movieSrv.GetMovie(mvCode);
                txtMovieName.Text = movie.MovieName;
                txtMovieDetail.Text = movie.Synopsis;
            }
            catch (Exception)
            {
                
                throw;
            }
        }

        protected void btnReview_Click(object sender, EventArgs e)
        {
            Response.Redirect("MovieReview.aspx?MVCode=" + movie.MovieCode);
        }
    }
}